package io.renren.modules.front.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;

import io.renren.modules.api.entity.UserEntity;
import io.renren.modules.api.service.UserService;
import io.renren.modules.front.base.FrontBaseController;

/**
 * <p>
 * TODO class
 * </p>
 *
 * @author yuxiaobin
 * @date 2017/8/22
 */
@Controller
@RequestMapping("/sample")
public class SampleController extends FrontBaseController{

    @Autowired
    UserService userService;

    @GetMapping("/test")
    @ResponseBody
    public Object sampleTest(){
        List<UserEntity> userList = userService.selectList(new EntityWrapper<UserEntity>());
        JSONObject json = new JSONObject(2);
        json.put("size", userList.size());
        return getSuccessResult(json);
    }
}
